let {TxType} = require('Poker')

cc.Class({
    extends: cc.Component,

    properties: {
        sigle: cc.Node,
        pair: cc.Node,
        twopair: cc.Node,
        three: cc.Node,
        straight: cc.Node,
        flush: cc.Node,
        fullhouse: cc.Node,
        four: cc.Node,
        straightflush: cc.Node,
        royal: cc.Node,
        preAni: cc.Node
    },

    // use this for initialization
    onLoad: function () {
    },

    play(type) {
        let anim = null
        let str = 'shengli'
        switch (type) {
            case 1:
                anim = this.sigle
                break
            case 20:
                anim = this.pair
                break
            case 40:
                anim = this.twopair
                break
            case 60:
                anim = this.three
                break
            case 80:
                anim = this.straight
                break
            case 100:
                anim = this.flush
                break
            case 120:
                anim = this.fullhouse
                break
            case 140:
                anim = this.four
                break
            case 160:
                anim = this.straightflush
                break
            default:
                anim = this.royal
                break
        }
        anim.active = true
        let skeleton = anim.getComponent(sp.Skeleton)
        skeleton.setAnimation(0, str, false)
        this.preAni = anim
    },

    clear() {
        if (this.preAni) this.preAni.active = false
    }



    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
